An interpreter is a computer program that translates and executes instructions written in a programming language, such as programs written in the Java bytecode language. The translation process involves the conversion of each source language statement of a given computer program into machine language suitable for execution. A user wishing to execute an application program written in the programming language will invoke an interpreter in order to execute the application program.
In object oriented programming languages, every object belongs to a specific "class," sometimes called an object class. Every object is an instance of a respective object class. Further, programs in object oriented computer systems are often called "methods," and each method belongs to a respective object class.
Methods (particularly application programs) often contain references to other methods that are located separate and apart from the calling method. Typically, these references take the form of a unique name or symbol which corresponds to the particular sub unit of code. As part of the interpretation process required to execute a given method, the interpreter must resolve each reference or symbol in order to locate and ultimately translate the method associated with a given symbol.
In the prior art, the interpretation process for a symbolic reference to a method involved a one or two step process. Some prior art interpreters utilize local system resources (libraries and the like) to resolve symbolic references. In the event the local system resources could not resolve a given symbol, then the interpretation (compilation) aborts with an appropriate message to the user. In other prior art interpreters, if the local resources could not resolve a symbolic reference, then a search strategy is invoked. The particular search strategy invoked by the interpreter may be unique to the individual computer. Accordingly, the ability of the interpreter to resolve these unknown (at least locally) symbolic references is directly related to the effectiveness of the resident search routine. Again, as with other prior art interpreters, if the symbol could not be resolved by the resident search routine, then the interpretation process aborts with an appropriate message to the user.
In a distributed computer system, a method being executed by a first (client) computer may contain references, herein called symbols, to methods located on a number of other (server) computers. In order to translate and execute a method which contains references to remotely stored methods, the program interpreter is required to resolve all of the references to remote methods. However, the local system resources (client resources) available to an interpreter to translate symbolic references may not be the same as the resources (server resources) available at the other server computers. Specifically, the resources available at a server computer may be more expansive or the server may employ a different search routine which has been tailored to the object classes stored at its location.
Furthermore, when a first method is loaded from a remote server, any additional methods called by the first method are likely to be located on the same remote server that supplied the first method. Importantly, the remote server may store a version of the called method that is required for correct operation of the first method. In other words, there may be many methods having the same name that are located on various client and server computers. Thus, when Method A on Server 1 makes a call to Method X, and different versions of Method A are stored on various servers and clients, Method X on Server 1 most likely needs to use the Server 1 version of Method X. Therefore, in most circumstances, the first place to look for such called methods would be that same remote server.
However, if the client's default class loading procedure is used to locate and load these called methods, local resources will be searched first, and the search for the called methods either may never be extended to the remote server, or may extend to the remote server only after an unfruitful search of the local resources. This is wasteful, and may result in the wrong method (i.e., the local version of the called method instead of the remotely stored version) being loaded.
It is therefore an object of the present invention to provide a method and system for resolving symbolic references to remotely located methods. It is an associated object of the present invention to provide a method and system in which the default search strategy for locating a called method is superseded by an application specific search strategy when the calling method was loaded by the executing client computer from a remotely located server.